import { defineStore } from 'pinia';
import { addUser, editAgentsUserInfoApi } from '@/api/user';
// import { storage } from '@/utils/storage';

interface AgentsState {}

export const useAgentsStore = defineStore({
  id: 'agents',
  state: (): AgentsState => ({}),
  getters: {},
  actions: {
    async addUserAction(data: any) {
      await addUser(data);
      // 获取代理列表
      ElMessage.success('添加成功');
    },
    async editAgentsUserInfoAction(data: any) {
      await editAgentsUserInfoApi(data);
      ElMessage.success('编辑成功');
    }
    // async getAgentsUserListAction(param: any) {
    //     const { data } = await getAgentsUserListApi(param);
    //     console.log(data)
    // }
  }
});
